<?php declare(strict_types=1);

namespace Zyucv7\Core\Router;

use Zyucv7\Core\Web\Request;

/**
 * URI 解析类
 */

 class Uri
{
    private $path;
    private $method;

    public function __construct()
    {
        $req = Request::instance();
        $this->path = $req->getPath();
        $this->method = $req->getMethod();
    }

    public function getPath(): string
    {
        return $this->path ?: '/';
    }

    public function getMethod(): string
    {
        return $this->method;
    }
}